﻿using System;
using Echo.Context.UltiProNet.Contexts;
using Echo.Core.Common;
using Echo.Core.TestAbstraction.WebUITest.MbUnit;
using Echo.Models.UltimateSoftware.WebUITest.MbUnit;
using MbUnit.Framework;

////*************************************************************************************************************************************
////Created by: Adam Cando
////Date created: 5/29/2012
////Modified by:
////Date modified: 
////Reason: Converting SWAT script to Echo
////ULTI-00000 JIRA Description.
////SWAT Test Path: C:\Projects\UltiPro.NET\AutomatedTests\FitNesse\fitnesse\FitNesseRoot\SuiteCompliance\SuiteDotNet\SuiteCompanyTaxSetup\SuiteGuiTests\TestDedGoalUpdater
////Prior Test Note: Based off of test cases found in \\denver2\groups\Compliance\Areas\BUSINESS RULES WEB
////TODO: Need to assert the amount field is not editable (Test case 12, 13)
////TODO: Need to assert alphabetical order of dropdown and company selector
////*************************************************************************************************************************************

namespace Echo.Automation.Compliance.BusinessRules
{
    [TestFixture]
    [Header("Config")]
    [Config(".NET")]
    [Author("Adam Cando", "adam_cando@ultimatesoftware.com")]
    [Category("Company Tax Setup")]
    public class TestDedGoalUpdater : MbUnitAutomatedTest
    {
        #region Setups/Teardowns and Variables
        UltiPro UltiPro;
        private UltiProDatabaseContext Database;
        private const string CalendarCompany = "CALEN";
        private const string WebPayrollCompany = "C0014";
        private const string CompletedReportName = "Employee Deduction Listing";

        [FixtureSetUp]
        public void FixtureSetUp()
        {
            UltiPro = Launch<UltiPro>();
            Database = Init<UltiProDatabaseContext>();
            Database.Company = ConfigDatabase("ULTIPRO_CALENDAR");
            UltiPro.Pages.Login.LoginAs("MerrillG", "password", Config.LanguageCode);
            UltiPro.Pages.CompanySelector.ChooseCompanies(CalendarCompany, WebPayrollCompany);
        }

        [FixtureTearDown]
        public void FixtureTearDown()
        {
            UltiPro.Browser.Quit();
            DatabaseTeardownStatements();
        }

        [SetUp]
        public void Setup()
        {
            UltiPro.Menu.PayrollAdmin.Click(x => x.DeductionGoalUpdate);
        }
        #endregion

        #region Test Methods
        [Test]
        public void Validate_Page_elements_and_default_options()
        {
            UltiPro.Pages.DeductionGoalUpdate.Is(x => x.PageHeaderLabel, "innerHTML", "Deduction Goal Update");

            UltiPro.Pages.DeductionGoalUpdate.HasOptions(x => x.DeductionDropDown,
                "ADD", "OT1", "OPC", "DEF", "DEN", "OPT", "FSA", "GTL", "HRA",
                "HSA", "LTC", "LTD", "MED", "OT2", "OTH", "PRP", "DRG", "STD",
                "OPS", "TRC", "TRP", "VIS");

            // Check that Loan and Garnishment do not exist in the dropdown
            UltiPro.Pages.DeductionGoalUpdate.DoesNotHaveOptions(x => x.DeductionDropDown, SelectOption.Text, "Garnishment", "Loan");

            // Check that the Company option mover's destination is empty
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.NotEnabled(x => x.Destination);

            // Select All Checkbox should not be selected by default
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.NotSelected(x => x.SelectAllCheckbox);
        }
        
        [Test]
        public void Select_all_checkbox_should_be_disabled_until_a_deduction_type_is_selected()
        {
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.NotEnabled(x => x.SelectAllCheckbox);
            SelectDeductionType("OTH");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Enabled(x => x.SelectAllCheckbox);
        }

        [Test]
        public void Select_all_checkbox_should_select_checkbox_on_all_rows()
        {
            #region Given the additional deduction type is selected and the default state is validated
            SelectDeductionType("OT1");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.NotSelected(x => x.SelectAllCheckbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CR15A").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FXPCT").NotSelected(x => x.Checkbox);
            #endregion

            #region When the select all checkbox is clicked
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Click(x => x.SelectAllCheckbox);
            #endregion

            #region Then the individual checkboxs on each row should all be selected
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Selected(x => x.SelectAllCheckbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CR15A").Selected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FXPCT").Selected(x => x.Checkbox);
            #endregion

            #region When the select all checkbox is clicked again
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Click(x => x.SelectAllCheckbox);
            #endregion

            #region Then all the checkboxes should be unselected once again
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.NotSelected(x => x.SelectAllCheckbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CR15A").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FXPCT").NotSelected(x => x.Checkbox);
            #endregion
        }

        [Test]
        public void Company_option_mover_should_be_disabled_until_a_deduction_type_is_selected()
        {
            #region Given the option mover fields are disabled before the deduction type is selected
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.NotEnabled(x => x.Source);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.NotEnabled(x => x.Destination);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.Click(x => x.ArrowRightAll);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.DoesNotHaveOptions(x => x.Destination);
            #endregion

            #region When a deduction type is selected
            SelectDeductionType("OT1");
            #endregion

            #region Then the option mover and all of its controls should be enabled
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.Enabled(x => x.Source);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.Enabled(x => x.Destination);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.Click(x => x.ArrowRightAll);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.DoesNotHaveOptions(x => x.Source);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.Click(x => x.ArrowLeftAll);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.DoesNotHaveOptions(x => x.Destination);
            #endregion
        }

        [Test]
        public void Validate_that_the_page_displays_the_proper_message_when_the_deduction_type_is_changed()
        {
            #region Given a deduction type is already selected
            SelectDeductionType("OTH");
            #endregion

            #region When the deduction type is changed
            UltiPro.Pages.DeductionGoalUpdate.Set(x => x.DeductionDropDown, "OT1");
            #endregion

            #region Then an alert should appear with the proper message
            UltiPro.Alert.Exists();
            UltiPro.Alert.VerifyText("By changing the deduction type, any information entered on this page will be reset.");
            UltiPro.Alert.Accept();
            #endregion
        }

        [Test]
        public void Validate_that_when_a_deduction_type_is_selected_without_recoreds_the_deduction_grid_displays_the_proper_message()
        {
            SelectDeductionType("ADD");

            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Is(x => x.GridMessage, "innerHTML", "No records found");
        }

        [Test]
        public void Verify_the_Additional_deduction_type_grid_displays_the_proper_data()
        {
            SelectDeductionType("OT1");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CR15A").RowExists();
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FXPCT").RowExists();
        }

        [Test]
        public void Validate_the_Other_deduction_type_data_is_correct()
        {
            SelectDeductionType("OTH");

            #region Specific Test Case Comments
            // Verify that deductions that are populated with a stop date equal to or less than the server date in DedDEdeffstopdate are not displayed in the deduction code list
            // Verify that deductions that are populated with a stop date greater than the server date (future stop date) in DedDEdeffstopdate are displayed in the deduction code list
            // Verify that deductions with goal types of C or R are Not displayed in the deduction code list
            // Verify that deductions with goal types of Z are not displayed in the in deduction code list.
            #endregion
            
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFFDS").RowNotExists();
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FUTSD").RowNotExists();
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFGRC").RowNotExists();
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFGRR").RowNotExists();
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EXPR").RowNotExists();
            
            // Ensure that null values display as $0.00
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFGRM").Is(x => x.GoalAmount, "innerHTML", "$0.00");

            // Checking for alphabetical ordering of rows by code
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(0).Is(x => x.Code, "innerHTML", "CFLF2");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(1).Is(x => x.Code, "innerHTML", "CFLSF");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(2).Is(x => x.Code, "innerHTML", "CPITB");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(3).Is(x => x.Code, "innerHTML", "CPITL");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(4).Is(x => x.Code, "innerHTML", "CPITO");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(5).Is(x => x.Code, "innerHTML", "EDOT2");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(6).Is(x => x.Code, "innerHTML", "EFGRM");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(7).Is(x => x.Code, "innerHTML", "EFGRY");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(8).Is(x => x.Code, "innerHTML", "FXRAT");
        }

        [Test]
        public void Verify_rows_can_be_selected_individually()
        {
            #region Given the Other deduction type is selected and no checkboxes are selected
            SelectDeductionType("OTH");

            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITB").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CFLF2").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CFLSF").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITL").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITO").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFGRM").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFGRY").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FXRAT").NotSelected(x => x.Checkbox);
            #endregion

            #region When one row's checkbox is selected
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITB").Click(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFGRM").Click(x => x.Checkbox);
            #endregion

            #region Then only the clicked checkboxes should be selected
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITB").Selected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CFLF2").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CFLSF").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITL").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITO").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFGRM").Selected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "EFGRY").NotSelected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FXRAT").NotSelected(x => x.Checkbox);
            #endregion
        }

        [Test]
        public void Verify_reset_button_functions_as_desired()
        {
            #region Given the page has some changes to both the grid and the company mover box
            SelectDeductionType("OTH");

            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITO").Click(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FXRAT").Click(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.MoveRight(WebPayrollCompany);

            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITO").Selected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "FXRAT").Selected(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.HasOptions(x => x.Destination, WebPayrollCompany);
            #endregion

            #region When the reset button is clicked
            UltiPro.Pages.DeductionGoalUpdate.ButtonBar.Click(x => x.Reset);
            #endregion

            #region Then the page should result to the default settings
            Validate_Page_elements_and_default_options();
            #endregion
        }

        [Test]
        public void Check_error_message_displays_when_the_run_button_is_clicked()
        {
            #region Given a deduction type is selected
            SelectDeductionType("OTH");
            #endregion

            #region When the run button on a blank page is clicked
            UltiPro.Pages.DeductionGoalUpdate.ButtonBar.Click(x => x.Save);
            #endregion

            #region Then there should be two error messages displayed
            UltiPro.Pages.DeductionGoalUpdate.ErrorMessages.HasOnly(
                "At least one deduction code must be checked.",
                "At least one company must be selected.");
            #endregion

            #region Given only a company is selected
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.MoveRight(WebPayrollCompany);
            #endregion

            #region When the run button on a blank page is clicked
            UltiPro.Pages.DeductionGoalUpdate.ButtonBar.Click(x => x.Save);
            #endregion

            #region Then only the deduction code error message should display
            UltiPro.Pages.DeductionGoalUpdate.ErrorMessages.HasOnly("At least one deduction code must be checked.");
            #endregion

            #region Given only a deduction type is selected
            Setup();
            SelectDeductionType("OTH");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(0).Click(x => x.Checkbox);
            #endregion

            #region When the run button on a blank page is clicked
            UltiPro.Pages.DeductionGoalUpdate.ButtonBar.Click(x => x.Save);
            #endregion

            #region Then only the company error message should display
            UltiPro.Pages.DeductionGoalUpdate.ErrorMessages.HasOnly("At least one company must be selected.");
            #endregion
        }

        [Test]
        public void Verify_warning_message_when_deduction_codes_and_companies_are_selected_and_submit_button_is_clicked()
        {
            #region Given a deduction and a company are selected
            SelectDeductionType("OTH");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "CPITB").Click(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.MoveRight(WebPayrollCompany);
            #endregion

            #region When the submit button is clicked
            UltiPro.Pages.DeductionGoalUpdate.ButtonBar.Click(x => x.Save);
            #endregion

            #region Then the proper waring messages should appear
            UltiPro.Pages.DeductionGoalUpdate.WarningMessages.HasOnly("Employee deduction records will be updated.");
            UltiPro.Pages.DeductionGoalUpdate.WarningMessages.Exists(x => x.IgnoreButton);
            #endregion

            #region When the Ignore button is clicked
            UltiPro.Pages.DeductionGoalUpdate.WarningMessages.Click(x => x.IgnoreButton);
            #endregion

            #region Then an error message should display
            UltiPro.Pages.DeductionGoalUpdate.ErrorMessages.HasOnly("No employees found for update.");
            #endregion
        }

        [Test]
        public void Test_sql_updates_for_deduction_goal_amounts()
        {
            SelectDeductionType("DEF");
            UltiPro.Pages.DeductionGoalUpdate.TaxCollectionDistrictsGrid.Row(x => x.Code, "PR401").Click(x => x.Checkbox);
            UltiPro.Pages.DeductionGoalUpdate.CompanyOptionMover.MoveRight(WebPayrollCompany);

            DatabaseUpdateStatements();
            
            UltiPro.Pages.DeductionGoalUpdate.ButtonBar.Click(x => x.Save);
            UltiPro.Pages.DeductionGoalUpdate.WarningMessages.Click(x => x.IgnoreButton);

            UltiPro.Pages.DeductionGoalUpdate.InformationMessages.HasOnly("Deduction goal update request has been submitted. When the process is complete, the Employee Deduction Listing reports will display in the Standard Reports - Completed tab.");
            Database.Company.Verify("select eedeeid, eedeegoalamt from empded where eedeeid in ('5IW73F0000K0', '4BH7ZW01H0K0', '4BH7ZW01G0K0', '4BH7ZW01I0K0', '4BH7ZW01P0K0', '4BH7ZW01R0K0', '4BH7ZW01Q0K0', '4BH7ZW01S0K0', '4BH7ZW01T0K0', '4BH7ZW01U0K0', '4BH7ZW01W0K0', '4BH7ZW01X0K0', '4BH7ZW01Y0K0', '4BH7ZW01Z0K0', '4BH7ZW01K0K0') AND eeddedcode = 'PR401'", "TestDedGoalUpdater.xml");

            UltiPro.Menu.Reporting.Click(x => x.Completed);
            UltiPro.Macros.StandardReports.PollForCompletedReport(UltiPro.Pages.SRReportInbox.SRReportInboxGrid.Row(x => x.ReportName, CompletedReportName), 180);
        }
        #endregion

        #region Helper Methods
        private void SelectDeductionType(string deductionType)
        {
            UltiPro.Pages.DeductionGoalUpdate.Set(x => x.DeductionDropDown, deductionType);
            
            try
            {
                UltiPro.Alert.NotExists();
            }
            catch (Exception)
            {
                UltiPro.Alert.Accept();
            }
        }

        private void DatabaseUpdateStatements()
        {
            Database.Company.Execute(string.Format("DELETE FROM FileInfo WHERE FilDescription LIKE '{0}%'", CompletedReportName));
            Database.Company.Execute("update empded set eedeegoalamt='10000.00' where eedcoid='C0014' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='T' where eedeeid='5IW73F0000K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='C' where eedeeid='4BH7ZW01H0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='P' where eedeeid='4BH7ZW01G0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='W' where eedeeid='4BH7ZW01I0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='T', eedstopdate=getdate() where eedeeid='4BH7ZW01P0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedstopdate=getdate() where eedeeid='4BH7ZW01R0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='C', eedstopdate=getdate() where eedeeid='4BH7ZW01Q0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='P', eedstopdate=getdate() where eedeeid='4BH7ZW01S0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='W', eedstopdate=getdate() where eedeeid='4BH7ZW01T0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='T', eedstopdate=getdate()+1 where eedeeid='4BH7ZW01U0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedstopdate=getdate()+1 where eedeeid='4BH7ZW01W0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='C', eedstopdate=getdate()+1 where eedeeid='4BH7ZW01X0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='P', eedstopdate=getdate()+1 where eedeeid='4BH7ZW01Y0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='W', eedstopdate=getdate()+1 where eedeeid='4BH7ZW01Z0K0' and eeddedcode='pr401'");
        }

        private void DatabaseTeardownStatements()
        {
            Database.Company.Execute(string.Format("DELETE FROM FileInfo WHERE FilDescription LIKE '{0}%'", CompletedReportName));
            Database.Company.Execute("update empded set eedeegoalamt='16500.00' where eedcoid='C0014' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A' where eedeeid='5IW73F0000K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A' where eedeeid='4BH7ZW01H0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A' where eedeeid='4BH7ZW01G0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A' where eedeeid='4BH7ZW01I0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A', eedstopdate=null where eedeeid='4BH7ZW01P0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedstopdate=null where eedeeid='4BH7ZW01R0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A', eedstopdate=null where eedeeid='4BH7ZW01Q0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A', eedstopdate=null where eedeeid='4BH7ZW01S0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A', eedstopdate=null where eedeeid='4BH7ZW01T0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A', eedstopdate=null where eedeeid='4BH7ZW01U0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedstopdate=null where eedeeid='4BH7ZW01W0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A', eedstopdate=null where eedeeid='4BH7ZW01X0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A', eedstopdate=null where eedeeid='4BH7ZW01Y0K0' and eeddedcode='pr401'");
            Database.Company.Execute("update empded set eedbenstatus='A', eedstopdate=null where eedeeid='4BH7ZW01Z0K0' and eeddedcode='pr401'");
        }
        #endregion
    }
}
